Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get import path from go.mod #34

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

1st-vil
Copy link

@1st-vil 1st-vil commented Feb 21, 2024

Overview

I fixed #33

Changed points

  • In main.go, There was a method findInModule that gets relative path from go.mod . I transformed it to a function to reuse it
  • Implemented findPackagePath to calculate the import path, and replaced existing process with it

Confirmation

I confirmed it works on a project structure shown as examples in #33

% gobco # existing version 1.3.2
# github.com/1st-vil/awesomeProject/something_test [github.com/1st-vil/awesomeProject/something.test]
./gobco_bridge_test.go:6:19: undefined: something.GobcoCover
FAIL    github.com/1st-vil/awesomeProject/something [build failed]
FAIL
go test .: exit status 1

% ~/gobco/gobco # executable file created from this PR
ok      github.com/1st-vil/awesomeProject/something     0.457s

Condition coverage: 0/0

@dakusui
Copy link

dakusui commented Sep 25, 2024

Hi!
@rillig (Cc: @junhwi @Pezzah )

Actually, I really want this PR to be merged as my team is experiencing the same problem as #33, where C1 (branch) coverage can't be measured for packages (xyz) that contain a test whose package is xyz_test.
Please let me know if anything that I can help.

Thanks a lot in advance!

FYI: In case you think closed conversation is needed, I sent out a linked in connection invitation. Please accept it and let me know your thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finding original package path in directory with _test package may fails
2 participants